/**
 * Project: common-cps
 * Created: 2017年2月15日
 * Copyright ©2011-2017 gopay Information Technology Co., LTD All Rights Reserved
**/
package com.gopay.common.cps.dao.cbrmb.impl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.cbrmb.CbrmbDrawRefundLogsDAO;
import com.gopay.common.domain.cbrmb.draw.CbrmbDrawRefundLogs;

/** 
 * 跨境人民币提现退款操作日志持久层接口实现类
 * @ClassName: CbrmbDrawRefundLogsDAOImpl 
 * @author junjie.ge 
 * @date 2017年2月15日 下午5:48:49  
 */
@Repository("cbrmbDrawRefundLogsDAO")
public class CbrmbDrawRefundLogsDAOImpl extends BaseDAOImpl<CbrmbDrawRefundLogs, Long> implements CbrmbDrawRefundLogsDAO {

    @Override
    public List<CbrmbDrawRefundLogs> findByDrawGopayOrderIdAndCreateTime(String drawGopayOrderId, Date begin,
            Date end) {
        String hql = "from CbrmbDrawRefundLogs where drawGopayOrderId = :drawOrderId and createTime >= :beginTime and createTime <= :endTime order by createTime desc";
        Map<String, Object> param = new HashMap<>();
        param.put("drawOrderId", drawGopayOrderId);
        param.put("beginTime", begin);
        param.put("endTime", end);
        return super.findByHql(hql, param);
    }

}
